Skip to content

revert(coding-agent): restore subagent cleanup guidance - #1955

Merged
snimu merged 2 commits into
mainfrom
revert/pr-1952-subagent-deletion
Sep 1, 2026
Merged

snimu merged 2 commits into
mainfrom
revert/pr-1952-subagent-deletion

Conversation

@sethkarten

@sethkarten sethkarten commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Why

Requiring an explicit user request for every deletion causes completed subagent sessions to accumulate and retain memory. Cleanup should remain the default once a direct subagent is no longer needed.

Validation

  • test/system-prompt.test.ts: 25 passed
  • git diff --check: passed
  • npm run check: Biome passed; the local typecheck could not resolve pre-existing workspace dependencies (@smithy/types, @smithy/node-http-handler, @anthropic-ai/sdk, and grok-mermaid). CI will run in the complete repository environment.

Linear: ENG-5836


Note

Low Risk
Prompt-only change that nudges model behavior around subagent lifecycle; no runtime API or security surface changes.

Overview
Reverts #1952 and restores default subagent cleanup in the RLM harness system prompt.

In buildRlmPrompt (rlm.ts), the guidance for rlm.delete_subagent again tells parent agents to delete direct children when they are no longer needed, instead of limiting deletion to explicit user requests. The unreleased changelog note that documented the user-only policy is removed.

This is intended to stop finished subagent sessions from accumulating and holding memory when parents never get a delete instruction from the user.

Reviewed by Cursor Bugbot for commit 8f91731. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Restore subagent deletion guidance in buildRlmPrompt

Reverts the child-agent doctrine in rlm.ts so the prompt says to delete a direct child with await rlm.delete_subagent(child) when it is no longer needed, instead of only on explicit user request. Removes the now-obsolete changeset file prompt-subagent-deletion-user-only.md.

Macroscope summarized 8f91731.

Reverts #1952 so agents delete direct subagents when they are no longer needed instead of retaining them until a user explicitly requests deletion. Adds prompt coverage for the intended cleanup policy.
@snimu
snimu merged commit 48c69d4 into main Sep 1, 2026
23 of 24 checks passed
@snimu
snimu deleted the revert/pr-1952-subagent-deletion branch September 1, 2026 16:50
paralin pushed a commit to paralin/prime-agent that referenced this pull request Sep 2, 2026
…ct-ai#1955)

* revert(coding-agent): restore subagent cleanup guidance

Reverts PrimeIntellect-ai#1952 so agents delete direct subagents when they are no longer needed instead of retaining them until a user explicitly requests deletion. Adds prompt coverage for the intended cleanup policy.

* test(coding-agent): keep prompt rollback free of copy assertions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants